package org.crazyit.cloud;

import org.crazyit.cloud.contract.MyUrl;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author JLL
 * @Date 2019/2/8/0008 下午 8:56
 *
 * **
 *      * 使用的时候直接注入就可以，spring就帮我们创建出来了，我们不用写调用哪个地址，接口。
 *      */
@FeignClient(value = "spring-feign-provider") //调用哪个服务，这里传入那个服务ID就可以了
public interface HelloClient {

    @RequestMapping(method = RequestMethod.GET, value = "/hello/{name}")
    String hello(@PathVariable(value = "name") String name);

    @RequestMapping(method = RequestMethod.GET, value = "/call/{id}")
    Police getPolice(@PathVariable(value = "id") Integer id);

    @MyUrl(url = "/hellowd",method = "GET")
    String myHello();

}
